//轮播
var swiper = new Swiper('.swiper-container', {
	slidesPerView: 5,
	spaceBetween: 30,
	slidesPerGroup: 5,
	// init: false,
	//按钮
	navigation: {
		nextEl: '.swiper-button-next',
		prevEl: '.swiper-button-prev',
	},
	breakpoints: {
		1024: {
			slidesPerView: 4,
			spaceBetween: 40,
		},
		768: {
			slidesPerView: 3,
			spaceBetween: 30,
		},
		640: {
			slidesPerView: 2,
			spaceBetween: 20,
		},
		320: {
			slidesPerView: 1,
			spaceBetween: 10,
		}
	}
});


//企业咨询
var a=document.querySelector(".advisory");
var b=document.querySelector(".busine");
var q=document.querySelector(".quxiao");
a.addEventListener("click",function(){
	b.style.display='block';
})

q.addEventListener("click",function(){
	b.style.display='none';
})




//移入事件
//获取item
var item = document.querySelectorAll(".standby-bottom .item");
//console.log(item);
//获取详情
var detail = document.querySelectorAll(".standby-bottom1>.details");
//console.log(detail);

//遍历navLi

for(var i = 0; i < item.length; i++) {
	//给每一个item绑定一个下标
	item[i].index = i;
	item[i].addEventListener('mouseover', function() {
		for(var k = 0; k < item.length; k++) {
			//统一样式
			//移除active
			item[k].lastElementChild.classList.remove('active');
			detail[k].classList.remove('active');
		}
		//添加active
		this.lastElementChild.classList.add('active');
		detail[this.index].classList.add('active');
	})
}


//返回顶部
//获取#top
var t = document.querySelector("#top");
window.onscroll = function(){
	if(document.documentElement.scrollTop > 500 || document.body.scrollTop > 500){
		t.style.display = 'block';
	}else{
		t.style.display = 'none';
	}
}
t.addEventListener('click', function() {
	//平滑的滚动
	//	window.scrollTo(0,0);

	//	 老版本的浏览器不支持
	window.scrollTo({
		top: 0,
		behavior: 'smooth'
	})

})